class Dog{
  name: string;
  age: number;

  // name:string;
  // age:number;
  constructor(name:string , age:number){
    this.name = name;
    this.age = age;
  }
  bark(){
    alert('汪汪汪!');
  }
}

const dog = new Dog('小黑',4)
const dog2 = new Dog('小白',2)

console.log(dog);
console.log(dog2);
